﻿CREATE VIEW [dbo].[analysis_GetActiveProjectsWithInactiveManagers]
AS
SELECT     dbo.Projects.ProjectID, dbo.Projects.Name, dbo.Projects.Description, dbo.Projects.ManagerUserID, dbo.Projects.ActivelyUsed AS ProjectIsActive, 
                      dbo.Users.UserID AS ManagerUserName, dbo.Users.UserName, dbo.Users.IsActive AS UserIsActive, dbo.Projects.CreationDate, 
                      dbo.Projects.BilledAsOf
FROM         dbo.Projects INNER JOIN
                      dbo.Users ON dbo.Projects.ManagerUserID = dbo.Users.UserID
WHERE     (dbo.Projects.ActivelyUsed = 1) AND (dbo.Users.IsActive = 0);

